/**
 *
 */
package com.angel.io.factories.impl;

import java.util.HashMap;
import java.util.Map;

import com.angel.io.factories.FileColumnsFactory;

/**
 * @author William
 *
 */
public class OutlookFileColumnsFactory implements FileColumnsFactory{
	private Integer currentPosition = 0;

	private Map<String, Integer> columns = new HashMap<String, Integer>();

	public String getColumnNameAt(Integer position) {
		for(String columnName: this.columns.keySet()){
			if(this.columns.get(columnName) == position){
				return columnName;
			}
		}
		return null;
	}

	public Integer getColumnQuantity() {
		return this.columns.size();
	}

	public Integer getCurrentPosition() {
		return this.currentPosition;
	}

	public String getNextColumnName() {
		for(String columnName: this.columns.keySet()){
			if(this.columns.get(columnName) == this.getCurrentPosition()){
				this.currentPosition++;
				return columnName;
			}
		}
		return null;
	}

	public boolean hasMoreColumns() {
		return this.getColumnQuantity() > this.getCurrentPosition();
	}

	public void initialize() {
		columns.put("BEGIN:VCALENDAR",0);
		columns.put("METHOD:PUBLISH",1);
		columns.put("X-WR-TIMEZONE:US/Pacific",2);
		columns.put("PRODID:-//Apple Inc.//iCal 3.0//EN",3);
		columns.put("CALSCALE:GREGORIAN",4);
		columns.put("X-WR-CALNAME: Importacion.",5);
		columns.put("VERSION:2.0",6);
		columns.put("X-WR-RELCALID:F25432AC-0D07-48CB-AF89-1D2B23B80B8E",7);
		columns.put("X-APPLE-CALENDAR-COLOR:#F57802",8);
		columns.put("TRANSP:TRANSPARENT",9);
		columns.put("UID:",10);
		columns.put("DTSTART:",11);
		columns.put("DTEND:",12);
		columns.put("DESCRIPTION:",13);
		columns.put("STATUS:",14);
		columns.put("DTSTAMP:",15);
		columns.put("SUMMARY:",16);
		columns.put("CREATED:",17);
		columns.put("BEGIN:VALARM",18);
		columns.put("TRIGGER:PT60M",19);
		columns.put("ACTION:DISPLAY",20);
		columns.put("DESCRIPTION:Reminder",21);
		columns.put("END:VALARM",22);
		columns.put("END:VCALENDAR",23);
	}


}
